------------------------------------------------------------------------------
-- Status recording library for computercraft's scripts by Hea3veN
-- Version 0.1
------------------------------------------------------------------------------

loadfile("lib/serialize.lua")()

status = nil

function statusLoad()
	--print("1status = " .. tostring(status))
	status = unserialize('status')
	--print("status = " .. tostring(status))
	if status == nil or status.prog == nil then
		return false
	end
	if status.progData == nil then
		status.progData = {}
	end
	return status
end

function statusInit(prog)
	status = {prog=prog, progData={}}
	--print( status.prog)
	statusSave()
end

function statusEnd()
	status.prog = nil
	status.progData = {}
	statusSave()
end

function statusSave()
	serialize(status, 'status')
end

function statusSetProgData(data)
	status.progData = data
end

function statusGetProg()
	return status.prog
end

function statusGetProgData()
	return status.progData
end
